<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="p" uri="/pagination-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript"> 
$(document).ready(function () {  
    /* 根据省份获取城市 */  
    $("#storeType").change(function () {  
        $.post("${dynamicURL}/basicdata/queryStoreJson.action", {storeType:$("#storeType").val()}, function (data) {  
            /* 清空城市 */  
            $("#storeIdName option[value!='']").remove();  
             var jsonObj = eval(data);  
            for (var i = 0; i < jsonObj.length; i++) {  
                var $option = $("<option></option>");  
                $option.attr("value", jsonObj[i].id);  
                $option.text(jsonObj[i].name);  
                $("#storeIdName").append($option);  
            }  
        });  
    });  
}); 
</script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>创建<s:property value="titleName"/>信息</title> 

</head>
<div id="breadcrumbs">
	<div style="overflow: hidden; position: relative; width: 750px;">
		<div>
			<ul style="width: 5000px;">
				<li class="first"></li>
				<li><a href="#">商品管理</a></li>
				<li><a href="#">产品信息管理</a></li>
				<li class="last"><a href="#">创建<s:property value="titleName"/></a></li>
			</ul>
		</div>
	</div>
</div>
<div class="section">
	<jsp:include page="/common/messages.jsp" />
	<div class="box">
		<div class="title">
			创建<s:property value="titleName"/><span class="hide"></span>
		</div>
		<div class="content">
			<s:form action="addAsnHeader" namespace="/asn" method="post" id="createForm">
				<s:hidden name="actionCommand" value="add"/>				
				<div class="row">
					<div class="row">
						<div class="tableLeft">
							<label>供应商:<span></span></label>		
							<s:select name="asnHeader.supplierId" list="supplierList" listKey="id" listValue="name" cssClass="leftSelect"/>
						</div>
						<div class="tableRight">
							<label>门店类型:</label>
							<s:select id="storeType" name="searchModel.storeType" list="storeTypeList" listKey="id" listValue="name" headerKey="" headerValue="所有" cssClass="rightSelect"/>
						</div>
					</div>
				
					<div class="row">
						<div class="tableLeft">
							<label>门店<span>*</span></label>
							<s:select id="storeIdName" name="asnHeader.storeId" list="storeList" listKey="id" listValue="name" cssClass="leftSelect"/>
						</div>
						<div class="tableRight">
							<label>入库单类型:<span>*</span></label>
							<s:select name="asnHeader.type" list="asnTypeList" listKey="id" listValue="name" cssClass="rightSelect"/>
						</div>						
					</div>
					<div class="row">
							<label>备注:<span>*</span></label>
							<div class="right">
								<s:textarea name="asnHeader.remark" rows="1" cols="45"></s:textarea>
							</div>							
					</div>
				<div class="row">
					<input type="submit" value="创建" class="button orange" onclick="createModel()" />&nbsp;&nbsp;
					<button type="reset" ><span>重置</span></button>
					<button type="submit" class="blue" onclick="searchForm()"><span>查询</span></button>
				</div> 
			</s:form>
		</div>
	</div>
</div>
<script type="text/javascript"> 
function createModel(){
	$("#createForm").submit();
}
function searchForm(){
	document.getElementById('createForm').onsubmit=function(){ return false; };
	window.location.href = "${dynamicURL}/asn/searchAsnHeader.action";
}

$(document).ready(function () {      
    $("#region").change(function () {  
        $.post("${dynamicURL}/basicdata/queryStoreByRegionJson.action", {regionId:$("#region").val()}, function (data) {  
            //$("#store option[value!='']").remove();
            $("#store").empty();
            var jsonObj = eval(data);  
            for (var i = 0; i < jsonObj.length; i++) {  
                var $option = $("<option></option>");  
                $option.attr("value", jsonObj[i].id);  
                $option.text(jsonObj[i].name);  
                $("#store").append($option);  
            }  
        });  
    });  
}); 
</script>


</html>
